﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Engine.Graphics
{
    #region QuadPosition Texture

    public class QuadPositionTexture : UserModel<VertexPositionTexture, short>
    {
        const int QuadVertexCount = 4;
        const int QuadIndexCount = 6;

        public QuadPositionTexture()
            : base(null, QuadVertexCount)
        {
            vertices[0].Position = new Vector3(-1.0f, 1.0f, 0.0f); //Top left. (0)
            vertices[0].TextureCoordinate = new Vector2(0, 0);

            vertices[1].Position = new Vector3(1.0f, 1.0f, 0.0f); //Top right. (1)
            vertices[1].TextureCoordinate = new Vector2(1, 0);

            vertices[3].Position = new Vector3(1.0f, -1.0f, 0.0f); //Bottom right. (3)
            vertices[3].TextureCoordinate = new Vector2(1, 1);

            vertices[2].Position = new Vector3(-1.0f, -1.0f, 0.0f); //Bottom left. (2)
            vertices[2].TextureCoordinate = new Vector2(0, 1);



            CreateVertexBuffer();

            short[] Indices = new short[QuadIndexCount];
            Indices[0] = (short)0;
            Indices[1] = (short)3;
            Indices[2] = (short)2;
            Indices[3] = (short)0;
            Indices[4] = (short)1;
            Indices[5] = (short)3;

            CreateIndexBuffer(Indices);

        }
    }

    #endregion
}
